<?php
require_once("../lib/DbWrapper.class.php");
session_start();
require("../libs/Smarty.class.php");
require("../libs/myUtil.class.php");
$smarty = new Smarty;

$id = $_GET["id"];
//エラー処理で受け取るGET
$error_nickname_yn = $_GET["error_nickname_yn"];
$error_mailaddress_yn = $_GET["error_mailaddress_yn"];
$error_mailaddress_already = $_GET["error_mailaddress_already"];
$error_password_yn = $_GET["error_password_yn"];
//エラー処理用にアサイン
$smarty->assign("error_nickname_yn",$error_nickname_yn);
$smarty->assign("error_mailaddress_yn",$error_mailaddress_yn);
$smarty->assign("error_mailaddress_already",$error_mailaddress_already);
$smarty->assign("error_password_yn",$error_password_yn);

DbWrapper::dbChoice();

//エラー処理で受け取ったGETの値が存在するかを調べる処理
$sql = "SELECT count(*) FROM member WHERE id = \"".$id."\" AND delete_yn != 'y'";
$result = mysql_query($sql);
$row = mysql_fetch_row($result);
if($row[0] == 0){
    header("Location:http://localhost/bbs/admin/index.php");
}

//クエリを送信する
$sql = "SELECT * FROM member WHERE id = \"".$id."\" AND delete_yn != 'y'";
$result =mysql_query($sql);
$member = mysql_fetch_array($result);
$smarty->assign("member", $member);
print_r($member);
echo "<br>";
//confirm.phpでinput.phpから来たかどうか判別するための処理
$_SESSION["member_edit_input_id"] = rand();
print_r($_SESSION);
$smarty->display("member_edit_input.tpl");
?>